package com.ntschy.sys.entity.dto.menu;

import com.ntschy.common.core.entity.enums.SysMenuTypeEnum;
import com.ntschy.common.core.entity.enums.SysMenuVisibleEnum;
import com.ntschy.common.core.entity.enums.SysWhetherEnum;
import com.ntschy.sys.entity.valid.SysMenuGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author ezreal_geng
 */
@Data
@ApiModel(description = "菜单新增更新dto")
public class SysMenuAddUpdateDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单ID")
    @NotBlank(message = "菜单ID不能为空", groups = SysMenuGroups.Update.class)
    @Length(min = 36, max = 36, message = "菜单ID长度不合法", groups = SysMenuGroups.Update.class)
    private String id;

    @ApiModelProperty(value = "父菜单ID")
    @NotBlank(message = "父菜单ID不能为空", groups = {SysMenuGroups.Add.class, SysMenuGroups.Update.class} )
    private String parentId;

    @ApiModelProperty(value = "类型（0目录 1菜单 2按钮）")
    private SysMenuTypeEnum menuType;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "菜单名称")
    private String name;

    @ApiModelProperty(value = "显示顺序")
    @NotNull(message = "菜单显示顺序不能为空")
    private Integer orderNum;

    @ApiModelProperty(value = "是否为外链（0否 1是）")
    private SysWhetherEnum isFrame;

    @ApiModelProperty(value = "路由地址")
    @NotBlank(message = "路由地址不能为空")
    private String path;

    @ApiModelProperty(value = "显示状态（0显示 1隐藏）")
    private SysMenuVisibleEnum visible;

    @ApiModelProperty(value = "权限字符串")
    private String perms;

    @ApiModelProperty(value = "组件路径")
    private String component;

    @ApiModelProperty(value = "菜单|按钮请求地址")
    private String httpUrl;
}
